app.controller("sellerController",function(
    $scope,
    $controller,
    sellerService
){
    $controller('baseController',{$scope:$scope});
    $scope.entity = {};
    $scope.isAgree = false;
    $scope.searchEntity = {};
    $scope.list = [];

    $scope.show = function(){
        alert('haha');
    }
    $scope.add = function(){
        if($scope.isAgree){
            //添加操作
            sellerService.save($scope.entity).then(function(result){
                if(result.data.success){
                    location.href = "/shoplogin.html"
                }else {
                    alert(result.data.message);
                }
            });
        }else {
            alert('请先阅读相关规则');
        }
    }
    $scope.search = function(page,rows){
        sellerService.findPage(page,rows,$scope.searchEntity).then(function(result){
            $scope.pageModel.totalItems = result.data.total;
            $scope.list = result.data.rows;
        });
    }
});